package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * tb_spu实体类
 * 
 * @author 
 *
 */
public class TbSpu {
	/**主键*/
	private String id; 
	/**货号*/
	private String sn; 
	/**SPU名*/
	private String name; 
	/**副标题*/
	private String caption; 
	/**品牌ID*/
	private Integer brandId; 
	/**一级分类*/
	private Integer category1Id; 
	/**二级分类*/
	private Integer category2Id; 
	/**三级分类*/
	private Integer category3Id; 
	/**模板ID*/
	private Integer templateId; 
	/**运费模板id*/
	private Integer freightId; 
	/**图片*/
	private String image; 
	/**图片列表*/
	private String images; 
	/**售后服务*/
	private String saleService; 
	/**介绍*/
	private String introduction; 
	/**规格列表*/
	private String specItems; 
	/**参数列表*/
	private String paraItems; 
	/**销量*/
	private Integer saleNum; 
	/**评论数*/
	private Integer commentNum; 
	/**是否上架*/
	private String isMarketable; 
	/**是否启用规格*/
	private String isEnableSpec; 
	/**是否删除*/
	private String isDelete; 
	/**审核状态*/
	private String status; 
	/**
	 * 实例化
	 */
	public TbSpu() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public TbSpu(JSONObject obj) {
		this();
		if (obj.get("id") instanceof String) {
			this.setId((String) obj.get("id"));
		}
		if (obj.get("sn") instanceof String) {
			this.setSn((String) obj.get("sn"));
		}
		if (obj.get("name") instanceof String) {
			this.setName((String) obj.get("name"));
		}
		if (obj.get("caption") instanceof String) {
			this.setCaption((String) obj.get("caption"));
		}
		if (obj.get("brandId") instanceof Number) {
			this.setBrandId(((Number) obj.get("brandId")).intValue());
		}
		if (obj.get("category1Id") instanceof Number) {
			this.setCategory1Id(((Number) obj.get("category1Id")).intValue());
		}
		if (obj.get("category2Id") instanceof Number) {
			this.setCategory2Id(((Number) obj.get("category2Id")).intValue());
		}
		if (obj.get("category3Id") instanceof Number) {
			this.setCategory3Id(((Number) obj.get("category3Id")).intValue());
		}
		if (obj.get("templateId") instanceof Number) {
			this.setTemplateId(((Number) obj.get("templateId")).intValue());
		}
		if (obj.get("freightId") instanceof Number) {
			this.setFreightId(((Number) obj.get("freightId")).intValue());
		}
		if (obj.get("image") instanceof String) {
			this.setImage((String) obj.get("image"));
		}
		if (obj.get("images") instanceof String) {
			this.setImages((String) obj.get("images"));
		}
		if (obj.get("saleService") instanceof String) {
			this.setSaleService((String) obj.get("saleService"));
		}
		if (obj.get("introduction") instanceof String) {
			this.setIntroduction((String) obj.get("introduction"));
		}
		if (obj.get("specItems") instanceof String) {
			this.setSpecItems((String) obj.get("specItems"));
		}
		if (obj.get("paraItems") instanceof String) {
			this.setParaItems((String) obj.get("paraItems"));
		}
		if (obj.get("saleNum") instanceof Number) {
			this.setSaleNum(((Number) obj.get("saleNum")).intValue());
		}
		if (obj.get("commentNum") instanceof Number) {
			this.setCommentNum(((Number) obj.get("commentNum")).intValue());
		}
		if (obj.get("isMarketable") instanceof String) {
			this.setIsMarketable((String) obj.get("isMarketable"));
		}
		if (obj.get("isEnableSpec") instanceof String) {
			this.setIsEnableSpec((String) obj.get("isEnableSpec"));
		}
		if (obj.get("isDelete") instanceof String) {
			this.setIsDelete((String) obj.get("isDelete"));
		}
		if (obj.get("status") instanceof String) {
			this.setStatus((String) obj.get("status"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getSn() != null) {
			result.put("sn",this.getSn());
		}
		if (this.getName() != null) {
			result.put("name",this.getName());
		}
		if (this.getCaption() != null) {
			result.put("caption",this.getCaption());
		}
		if (this.getBrandId() != null) {
			result.put("brandId",this.getBrandId());
		}
		if (this.getCategory1Id() != null) {
			result.put("category1Id",this.getCategory1Id());
		}
		if (this.getCategory2Id() != null) {
			result.put("category2Id",this.getCategory2Id());
		}
		if (this.getCategory3Id() != null) {
			result.put("category3Id",this.getCategory3Id());
		}
		if (this.getTemplateId() != null) {
			result.put("templateId",this.getTemplateId());
		}
		if (this.getFreightId() != null) {
			result.put("freightId",this.getFreightId());
		}
		if (this.getImage() != null) {
			result.put("image",this.getImage());
		}
		if (this.getImages() != null) {
			result.put("images",this.getImages());
		}
		if (this.getSaleService() != null) {
			result.put("saleService",this.getSaleService());
		}
		if (this.getIntroduction() != null) {
			result.put("introduction",this.getIntroduction());
		}
		if (this.getSpecItems() != null) {
			result.put("specItems",this.getSpecItems());
		}
		if (this.getParaItems() != null) {
			result.put("paraItems",this.getParaItems());
		}
		if (this.getSaleNum() != null) {
			result.put("saleNum",this.getSaleNum());
		}
		if (this.getCommentNum() != null) {
			result.put("commentNum",this.getCommentNum());
		}
		if (this.getIsMarketable() != null) {
			result.put("isMarketable",this.getIsMarketable());
		}
		if (this.getIsEnableSpec() != null) {
			result.put("isEnableSpec",this.getIsEnableSpec());
		}
		if (this.getIsDelete() != null) {
			result.put("isDelete",this.getIsDelete());
		}
		if (this.getStatus() != null) {
			result.put("status",this.getStatus());
		}
		return result;
	}
	
	
	/**
	 * 获取id
	 * 
	 * @return
	 */
	public String getId() {
		return id;
	}

	/**
	 * 设置id
	 * 
	 * @param id
	 */
	public void setId(String id) {
		this.id = id;
	}
	
	/**
	 * 获取sn
	 * 
	 * @return
	 */
	public String getSn() {
		return sn;
	}

	/**
	 * 设置sn
	 * 
	 * @param sn
	 */
	public void setSn(String sn) {
		this.sn = sn;
	}
	
	/**
	 * 获取name
	 * 
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置name
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * 获取caption
	 * 
	 * @return
	 */
	public String getCaption() {
		return caption;
	}

	/**
	 * 设置caption
	 * 
	 * @param caption
	 */
	public void setCaption(String caption) {
		this.caption = caption;
	}
	
	/**
	 * 获取brandId
	 * 
	 * @return
	 */
	public Integer getBrandId() {
		return brandId;
	}

	/**
	 * 设置brandId
	 * 
	 * @param brandId
	 */
	public void setBrandId(Integer brandId) {
		this.brandId = brandId;
	}
	
	/**
	 * 获取category1Id
	 * 
	 * @return
	 */
	public Integer getCategory1Id() {
		return category1Id;
	}

	/**
	 * 设置category1Id
	 * 
	 * @param category1Id
	 */
	public void setCategory1Id(Integer category1Id) {
		this.category1Id = category1Id;
	}
	
	/**
	 * 获取category2Id
	 * 
	 * @return
	 */
	public Integer getCategory2Id() {
		return category2Id;
	}

	/**
	 * 设置category2Id
	 * 
	 * @param category2Id
	 */
	public void setCategory2Id(Integer category2Id) {
		this.category2Id = category2Id;
	}
	
	/**
	 * 获取category3Id
	 * 
	 * @return
	 */
	public Integer getCategory3Id() {
		return category3Id;
	}

	/**
	 * 设置category3Id
	 * 
	 * @param category3Id
	 */
	public void setCategory3Id(Integer category3Id) {
		this.category3Id = category3Id;
	}
	
	/**
	 * 获取templateId
	 * 
	 * @return
	 */
	public Integer getTemplateId() {
		return templateId;
	}

	/**
	 * 设置templateId
	 * 
	 * @param templateId
	 */
	public void setTemplateId(Integer templateId) {
		this.templateId = templateId;
	}
	
	/**
	 * 获取freightId
	 * 
	 * @return
	 */
	public Integer getFreightId() {
		return freightId;
	}

	/**
	 * 设置freightId
	 * 
	 * @param freightId
	 */
	public void setFreightId(Integer freightId) {
		this.freightId = freightId;
	}
	
	/**
	 * 获取image
	 * 
	 * @return
	 */
	public String getImage() {
		return image;
	}

	/**
	 * 设置image
	 * 
	 * @param image
	 */
	public void setImage(String image) {
		this.image = image;
	}
	
	/**
	 * 获取images
	 * 
	 * @return
	 */
	public String getImages() {
		return images;
	}

	/**
	 * 设置images
	 * 
	 * @param images
	 */
	public void setImages(String images) {
		this.images = images;
	}
	
	/**
	 * 获取saleService
	 * 
	 * @return
	 */
	public String getSaleService() {
		return saleService;
	}

	/**
	 * 设置saleService
	 * 
	 * @param saleService
	 */
	public void setSaleService(String saleService) {
		this.saleService = saleService;
	}
	
	/**
	 * 获取introduction
	 * 
	 * @return
	 */
	public String getIntroduction() {
		return introduction;
	}

	/**
	 * 设置introduction
	 * 
	 * @param introduction
	 */
	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
	
	/**
	 * 获取specItems
	 * 
	 * @return
	 */
	public String getSpecItems() {
		return specItems;
	}

	/**
	 * 设置specItems
	 * 
	 * @param specItems
	 */
	public void setSpecItems(String specItems) {
		this.specItems = specItems;
	}
	
	/**
	 * 获取paraItems
	 * 
	 * @return
	 */
	public String getParaItems() {
		return paraItems;
	}

	/**
	 * 设置paraItems
	 * 
	 * @param paraItems
	 */
	public void setParaItems(String paraItems) {
		this.paraItems = paraItems;
	}
	
	/**
	 * 获取saleNum
	 * 
	 * @return
	 */
	public Integer getSaleNum() {
		return saleNum;
	}

	/**
	 * 设置saleNum
	 * 
	 * @param saleNum
	 */
	public void setSaleNum(Integer saleNum) {
		this.saleNum = saleNum;
	}
	
	/**
	 * 获取commentNum
	 * 
	 * @return
	 */
	public Integer getCommentNum() {
		return commentNum;
	}

	/**
	 * 设置commentNum
	 * 
	 * @param commentNum
	 */
	public void setCommentNum(Integer commentNum) {
		this.commentNum = commentNum;
	}
	
	/**
	 * 获取isMarketable
	 * 
	 * @return
	 */
	public String getIsMarketable() {
		return isMarketable;
	}

	/**
	 * 设置isMarketable
	 * 
	 * @param isMarketable
	 */
	public void setIsMarketable(String isMarketable) {
		this.isMarketable = isMarketable;
	}
	
	/**
	 * 获取isEnableSpec
	 * 
	 * @return
	 */
	public String getIsEnableSpec() {
		return isEnableSpec;
	}

	/**
	 * 设置isEnableSpec
	 * 
	 * @param isEnableSpec
	 */
	public void setIsEnableSpec(String isEnableSpec) {
		this.isEnableSpec = isEnableSpec;
	}
	
	/**
	 * 获取isDelete
	 * 
	 * @return
	 */
	public String getIsDelete() {
		return isDelete;
	}

	/**
	 * 设置isDelete
	 * 
	 * @param isDelete
	 */
	public void setIsDelete(String isDelete) {
		this.isDelete = isDelete;
	}
	
	/**
	 * 获取status
	 * 
	 * @return
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * 设置status
	 * 
	 * @param status
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "TbSpu [id=" + id + " , sn=" + sn + " , name=" + name + " , caption=" + caption + " , brandId=" + brandId + " , category1Id=" + category1Id + " , category2Id=" + category2Id + " , category3Id=" + category3Id + " , templateId=" + templateId + " , freightId=" + freightId + " , image=" + image + " , images=" + images + " , saleService=" + saleService + " , introduction=" + introduction + " , specItems=" + specItems + " , paraItems=" + paraItems + " , saleNum=" + saleNum + " , commentNum=" + commentNum + " , isMarketable=" + isMarketable + " , isEnableSpec=" + isEnableSpec + " , isDelete=" + isDelete + " , status=" + status + "  ]";
	
	}
	
	
}
